package org.lemon.cla.dto.request;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import lombok.Data;
import org.lemon.cla.enums.BookStatusEnum; // 导入图书状态枚举

import java.time.LocalDate;

@Data
@Schema(description = "图书更新请求对象")
public class BookUpdateRequest {

    // ISBN 可以更新，但通常不建议频繁修改唯一标识符
    @Schema(description = "ISBN (图书国标标号)", example = "978-7-121-12345-6")
    private String isbn;

    @Schema(description = "书名", example = "Spring Boot 进阶")
    private String title;

    @Schema(description = "封面URL", example = "http://example.com/new_book_cover.jpg")
    private String coverUrl;

    @Schema(description = "作者", example = "李四")
    private String author;

    @Schema(description = "出版社", example = "清华大学出版社")
    private String publisher;

    @Schema(description = "出版日期", example = "2024-03-15")
    private LocalDate publishDate;

    @Min(value = 0, message = "库存数量不能小于0")
    @Schema(description = "库存数量", example = "120")
    private Integer totalCopies;

    @Min(value = 0, message = "剩余数量不能小于0")
    @Schema(description = "剩余数量", example = "110")
    private Integer availableCopies;

    @Schema(description = "存放位置", example = "B区1层5排")
    private String location;

    @Schema(description = "图书状态", example = "可借", allowableValues = {"可借", "已借", "预约中", "维护中"})
    private BookStatusEnum status;
}